import 'package:flutter/material.dart';

class HomePage extends StatelessWidget {
  List<String> list;
  HomePage(this.list);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("跳转页面"),
        centerTitle: true,
      ),
      body: ListView.builder(
        itemBuilder: (context, index) {
          return Row(
            children: [
              Container(
                child: Text("${list[index]}"),
                padding: EdgeInsets.all(20.0),
              ),
              ElevatedButton(
                onPressed: () => Navigator.of(context).pushNamed(list[index]),
                child: Icon(Icons.send),
              )
            ],
          );
        },
        itemCount: list.length,
      ),
    );
  }
}
